import { httpInstance } from '@/utils/request'

interface AuthorizePhoneAPIData {
  code: string
  iv: string
  encryptedData: string
}

interface AuthorizePhoneAPIResData {
  code: number
  data: string
  msg: string
  time: string
}

export function authorizePhoneAPI(data: AuthorizePhoneAPIData, token: string) {
  return httpInstance.post<
    AuthorizePhoneAPIResData,
    AuthorizePhoneAPIData
  >('api/user/authorization_phone', data, { headers: { token } })
}
